import React, { Component, Fragment } from 'react'
import { withRouter } from 'react-router-dom'
import {
  Wrap,
  LeftHeader,
  ImgWrap,
  LeftHeaderTitle,
} from '../../../css/leftcss'
import MenuComponent from './Menu.js'
class LeftComponent extends Component {
  constructor(props) {
    super(props)
    this.state = {
      message: '左边',
      avaimgsrc: require('../../../images/avatar2.jpg'),
    }
    this.gotourl = this.gotourl.bind(this)
  }
  render() {
    return (
      <Fragment>
        <Wrap>
          <LeftHeader onClick={this.gotourl}>
            <ImgWrap></ImgWrap>
            <LeftHeaderTitle>管理系统</LeftHeaderTitle>
          </LeftHeader>
          <MenuComponent></MenuComponent>
        </Wrap>
      </Fragment>
    )
  }
  gotourl() {
    console.log('点击了')
    this.props.history.push({ pathname: '/' })
  }
}

export default withRouter(LeftComponent)
